<template>
	<view class="">
		<view class="box1">
		<!-- <view class="white f17"><Title :txt="type" :showback="true"></Title></view> -->
		
		<view class="register mb24">
			<view class="back">
				<image src="../../static/login/log-left.png" mode="" @click="gotoWallet" class="leftarrow"></image>
				<view class="f17 white fw0">{{type}}</view>
			</view>
		</view>
		
			<!-- 是usdt的时候显示 -->
			<view class="total" v-if="type == 'USDT-TRC20'">
				<view class="f14 white opacity05 mb13" >
					{{type}}{{i18n.zsl}}
				</view>
				<view class="f24 white pb25">
					{{total}}
				</view>
			</view>
			<!-- 是usdt的时候显示 -->
			
			<!-- 不是usdt的时候显示 -->
			<view v-if="type != 'USDT-TRC20'">
				<view class="total fsb" >
					<view class="flex-1">
						<view class="f14 white opacity05 mb13" >
							{{i18n.ky}}{{type}}
						</view>
						<view class="f24 white pb25">
							{{freezeMoney}}
						</view>
					</view>
					<view class="flex-1">
						<view class="f14 white opacity05 mb13" >
							{{i18n.zy}}{{type}}
						</view>
						<view class="f24 white pb25">
							{{lockMoney}}
						</view>
					</view>
				</view>
			</view>
			<!-- 不是usdt的时候显示 -->
			
		</view>
			<null v-if="list.length<=0"></null>
		<view class="profitdetal" v-if="list.length>0">
			<view class="describe" >
				<view class="white f16 ml13 mt23 pb18 mr13 border-bottoms">
					{{i18n.zcjl}}
				</view>
			</view>
			
			<view class="f15 mt14 ml15 mr15 white fsc border-bottoms" v-for="(item,index) in list" :key="index">
				<view class="tbbox">
					<view class="">
						{{item.remarks}}
					</view>
					<view class="f12 listcolor mt4 mb19">
						{{item.createDate}}
					</view>
				</view>
				<view class="f16 white" v-if="item.porm==0">
					+{{item.money}}
				</view>
				<view class="f16 white" v-if="item.porm==1">
					-{{item.money}}
				</view>
			</view>
			
			
			<!-- <view class="item fsc mgt24" v-for="(item,index) in list" :key="index">
				<view class="tbbox">
					<view class="f14">
						{{item.remarks}}
					</view>
					<view class="f12 grcolor mgt10">
						{{item.createDate}}
					</view>
				</view>
				<view :class="[item.porm==0?'blcolor':'','f16','f600' ]" v-if="item.porm==0">
				+{{item.money}}
				</view>
				<view :class="[item.porm==1?'orcolor':'','f16','f600' ]" v-if="item.porm==1">
				-{{item.money}}
				</view>
			</view> -->
		</view>
		
	</view>
	
</template>

<script>
	export default{
		data(){
			return{
			list:[],
				status:0,
				total:0, // 总数量
				type:"", // 币种名称
				coin:"", // 币种类型
				lockMoney:0, // 质押量
				freezeMoney:0, // 可用量
			}
		},
		onLoad(options) {
			this.type=options.coin
			
		},
		computed: {
			i18n() {
				return this.$t('ecology');
			}
		},
		onShow() {
			let params={
				coin:this.type,
				page:1,
				size:10
			}
			this.$http.post('wallet.getUserWaterByCoin',params,).then(res=>{
				// console.log(res)
				this.list=res.data.records
			})
			this.$http.post('wallet.getCoinInfo',params,).then(res=>{
				// console.log(res)
				this.total=res.data.money;
				this.lockMoney = res.data.lockMoney;
				this.freezeMoney = res.data.money;
			})
		},
		methods:{
			gotoWallet(){
				uni.reLaunch({
					url:"./wallet"
				})
			}
		}
	}
</script>

<style lang="less">
	page{
		background-color:#000 ;
	}
	.listcolor{
		color:#586471;
	}
	.opacity05{
		opacity:0.5;
	}
	.border-bottoms{
		border-bottom: 1px solid #2c2c2c;
	}
	.box1{
		// background-color: #fff;
		opacity: 1;
		background: linear-gradient(270deg,#204e72 0%, #0f2778 100%);
		
		.titlebox{
			padding-top: 40rpx;
			font-size: 34rpx;
			font-family: STSongti, STSongti-Bold;
			font-weight: 700;
			text-align: center;
			color: #202021;
			position: relative;
			
			.back{
				position: absolute;
				left: 0;
				top:40rpx;
				margin-left:30rpx
			}
		}
		.total{
			margin-top: 50rpx;
			font-family: PingFangSC, PingFangSC-Medium;
			font-weight: 500;
			color: #909399;
			// background-color: #fff;
			margin-left: 34rpx;
			margin-bottom: 26rpx;
		}
		.maintitle{
			margin-top: 40rpx;
			display: flex;
			justify-content: flex-start;
			align-items: center;
			background-color: #FFFFFF;
			.left{
				font-size: 68rpx;
				font-family: DINAlternate, DINAlternate-Bold;
				font-weight: 700;
				color: #202021;
				margin-right: 8rpx;
				margin-left: 30rpx;
			}
			.right{
				font-size: 28rpx;
				font-family: PingFangSC, PingFangSC-Medium;
				font-weight: 500;
				color: #202021;
				margin-top: 32rpx;
				
			}
		}
		.profitdetal{
			margin-top: 20rpx;
			padding: 30rpx 30rpx 0 30rpx;
			.item{
				border-bottom: 2rpx solid #E5E5E5;
				padding-bottom: 30rpx;
			}
			.describe{
				display: flex;
				justify-content: flex-start;
				align-items: center;
				.bluetitle{
					width: 8rpx;
					height: 32rpx;
					opacity: 1;
					background: #308ae4;
					margin-right: 12rpx;
				}
			}
		}
	}

.register {
	padding-top: 60rpx;
	.back {
		justify-content: center;
		align-items: center;
		display: flex;
		font-size: 34rpx;
		margin-left: 30rpx;
		position: relative;
		.leftarrow {
			position: absolute;
			left: 0;
			top: 0;
			width: 32rpx;
			height: 32rpx;
		}
	}
	.chrecord {
		position: absolute;
		top: 0;
		right: 0;
		margin-right: 30rpx;
		color:#586471;
	}
}

</style>
